﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:a="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View.AttachedBehaviors"
                    xmlns:v="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View;assembly=CodeCounsel.SharePoint.RibbonDesigner"
                    xmlns:t="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View.TypeConverters"                    
                    xmlns:vm="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.ViewModel;assembly=CodeCounsel.SharePoint.RibbonDesigner">
    <DataTemplate DataType="{x:Type vm:RibbonViewModel}">
        <v:Ribbon />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:TabViewModel}">
        <v:Tab />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:GroupViewModel}">
        <v:Group />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:GroupSectionViewModel}">
        <v:Section />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:GroupRowViewModel}">
        <v:Row />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:GroupOverflowSectionViewModel}">
        <v:OverflowSection />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:GroupOverflowRowViewModel}">
        <v:OverflowRow />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:ControlRefViewModel}">
        <v:ControlRef />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:ButtonViewModel}">
        <v:Button />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:UnknownControlViewModel}">
        <Border BorderBrush="Red" BorderThickness="2">
            <TextBlock Text="{Binding Message}" />
        </Border>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:EmptyControlViewModel}">
        <Border CornerRadius="4" BorderBrush="Black" BorderThickness="1" Margin="2">
            <Grid Background="Aquamarine" Opacity="0.25">
                <Grid.Style>
                    <Style TargetType="{x:Type Grid}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding DisplayMode}" Value="Large">
                                <Setter Property="Width" Value="32" />
                                <Setter Property="Height" Value="48" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DisplayMode}" Value="Medium">
                                <Setter Property="Width" Value="48" />
                                <Setter Property="Height" Value="16" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DisplayMode}" Value="Small">
                                <Setter Property="Width" Value="16" />
                                <Setter Property="Height" Value="16" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>
            </Grid>
        </Border>
    </DataTemplate>
    <DataTemplate x:Key="dragAdorner">
        <TextBlock Text="{Binding}" />
    </DataTemplate>
    <DataTemplate x:Key="dragButtonAdorner">
        <StackPanel>
            <TextBlock Text="{Binding}" />
            <TextBlock Text="Button" />
        </StackPanel>
    </DataTemplate>    
</ResourceDictionary>